package gstudio.ui;

import gstudio.data.IData;

import java.util.List;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class MyViewerContentProvider implements IStructuredContentProvider {

	@Override
	public void dispose() {

	}

	@SuppressWarnings("unchecked")
	@Override
	public Object[] getElements(Object obj) {
		if (obj != null && obj instanceof List) {
			List<IData> list = (List<IData>) obj;
			if (list.size() > 0) {
				return list.toArray();
			}
		}
		return new Object[0];
	}

	@Override
	public void inputChanged(Viewer arg0, Object arg1, Object arg2) {

	}
}
